raar.register
Class RASetRegister

java.lang.Object
  extended by raar.register.RARegister
      extended by raar.register.RASetRegister
All Implemented Interfaces:
java.io.Serializable

public class RASetRegister
extends RARegister
implements java.io.Serializable

This class defines a register for which you can only set values that already exist, and which can be copied COMPLETELY to an other register. In RAAR it is used to model process inputs. Once you have set the keys which should be in the register, it locks up and cannot be changed except using the set method for values.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class raar.register.RARegister
initialObjectVector, nameVector, objectVector
 
Constructor Summary
RASetRegister()
          Construct a new settable register
RASetRegister(java.util.Vector names, java.util.Vector values)
          Construct a new settable register with names and values.
 
Method Summary
 void add(java.lang.String name, RADataType dt)
          Since we may not add any new names, this method will throw an exception.
 void clearRegister(RARegister r)
          Replace the complete content by null.
 void copyToRegister(RARegister r)
          Copy the content of this register to the specified register, as far as the names defined in this register exist in the specified one (i.e. it makes no new keys).
 int getType(java.lang.String name)
          Return the type of the object stored under a name.
 boolean nameExists(java.lang.String name)
          Returns true if the specified name exists.
 void setNames(java.util.Vector names)
          Set the names (Strings in Vector) of the keys in this register.
 void setValues(java.util.Vector values)
          Set the content of the register, which must be as large (ntokens) as the keys.
 
Methods inherited from class raar.register.RARegister
accepts, clearRegister, get, getNameVector, getObjectVector, set, set, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RASetRegister

public RASetRegister()
Construct a new settable register


RASetRegister

public RASetRegister(java.util.Vector names,
                     java.util.Vector values)
              throws RAException
Construct a new settable register with names and values. You can do this only once; afterwards only values may be changed, names are fixed.

Throws:
RAException
Method Detail

setNames

public void setNames(java.util.Vector names)
Set the names (Strings in Vector) of the keys in this register. You may do this only once; after this the register locks and will throw an exception if you try to call this method.


setValues

public void setValues(java.util.Vector values)
               throws RAException
Set the content of the register, which must be as large (ntokens) as the keys. Otherwise you get an exception!

Throws:
RAException

copyToRegister

public void copyToRegister(RARegister r)
                    throws RAException
Copy the content of this register to the specified register, as far as the names defined in this register exist in the specified one (i.e. it makes no new keys).

Throws:
RAException

nameExists

public boolean nameExists(java.lang.String name)
                   throws RAException
Returns true if the specified name exists.

Overrides:
nameExists in class RARegister
Throws:
RAException

add

public void add(java.lang.String name,
                RADataType dt)
         throws RAException
Since we may not add any new names, this method will throw an exception.

Overrides:
add in class RARegister
Throws:
RAException

getType

public int getType(java.lang.String name)
            throws RAException
Return the type of the object stored under a name. Can throw an exception if it does not exist.

Overrides:
getType in class RARegister
Throws:
RAException

clearRegister

public void clearRegister(RARegister r)
                   throws RAException
Replace the complete content by null. I.e. every key requested will have an associated null output value. Also if you specify a register as an argument, in that register the values for keys also in this register will be set to null. Now read that again and try to understand :-)

Throws:
RAException